package co.yixiang.huiMin.service.impl;

import co.yixiang.huiMin.entity.Machinist;
import co.yixiang.huiMin.mapper.MachinistMapper;
import co.yixiang.huiMin.service.MachinistService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 机修师 服务实现类
 * </p>
 *
 * @author Author
 * @since 2020-07-01
 */
@Service
public class MachinistServiceImpl extends ServiceImpl<MachinistMapper, Machinist> implements MachinistService {

    @Resource
    private MachinistMapper machinistMapper;

    @Override
    public List<Machinist> selectMachinists() {
        QueryWrapper<Machinist> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("ma_del",0).orderByAsc("create_time");
        return machinistMapper.selectList(queryWrapper);
    }

    @Override
    public int updateMachinists(Machinist machinist) {
        return machinistMapper.updateById(machinist);
    }
}
